package pbc.gx.ekp.addressbook.utils;
public class SecurityUtils {

    private final static ThreadLocal<String> USERID_THREAD_LOCAL = new ThreadLocal<>();
    private final static ThreadLocal<String> ORGID_THREAD_LOCAL = new ThreadLocal<>();

    private final static ThreadLocal<Long> STARTTIME_THREAD_LOCAL = new ThreadLocal<>();

    /**
     * 获取 tokenId
     **/
    public static String getUserId() {
        return USERID_THREAD_LOCAL.get();
    }

    public static void setUserId(String userId) {
        USERID_THREAD_LOCAL.set(userId);
    }

    public static String getOrgId() {
        return ORGID_THREAD_LOCAL.get();
    }

    public static void setOrgId(String orgId) {
        ORGID_THREAD_LOCAL.set(orgId);
    }

    public static Long getStarTime() {
        return STARTTIME_THREAD_LOCAL.get();
    }

    public static void setStartTime(Long startTime) {
        STARTTIME_THREAD_LOCAL.set(startTime);
    }
}
